﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
///AOJForum 的摘要说明
/// </summary>
public class AOJForum:CForum
{
    public List<AOJProblem> aojp;
    public int searchCount;
	public AOJForum()
	{
        aojp = new List<AOJProblem>();
	}

    public AOJForum(int fid):base(fid)
    {
        aojp = new List<AOJProblem>();
    }

    public AOJForum(forums f):base(f)
    {
        aojp = new List<AOJProblem>();
    }


    public void getTopicc()
    {
        GetData gd = new GetData();
        List<threads> to = gd.GetThreads(m_fid);
        if (to == null)
            return;
        foreach (threads t in to)
        {
            AOJProblem tt = new AOJProblem(t);
            tt.CutTitle(20);
            aojp.Add(tt);
        }
    }

    public void getTopicc(int pageSize, int pageIndex, int type)
    {
        GetData gd = new GetData();
        List<threads> to = new List<threads>();
        if (type == 0)//只获取未删除
            to = gd.GetThreads(m_fid, pageIndex, pageSize);
        else if (type == 1)//获取全部
            to = gd.GetAllThreads(m_fid, pageIndex, pageSize);
        if (to == null)
            return;
        foreach (threads t in to)
        {
            AOJProblem tt = new AOJProblem(t);
            tt.CutTitle(20);
            aojp.Add(tt);
        }
    }


}